package com.gonsin.gview.common.bean;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import com.gonsin.gview.common.utils.MapJsonHandler;
import com.gonsin.gview.common.utils.StringListConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.type.ArrayTypeHandler;

import javax.persistence.*;
import java.util.List;
import java.util.Map;


/**
 * 会议大厦类
 */
@ApiModel("大厦信息")
@TableComment("会议中心表")
@Entity
@Data
@Table(name = "gs_user_edifice")
@TableName("gs_user_edifice")
public class EdificeBean {

    @Id
    @TableId("edifice_key")
    @ApiModelProperty("会议大厦的id")
    @Column(name = "edifice_key", columnDefinition = "varchar(64) comment '主键'")
    private String edificeKey;

    @TableField("name")
    @ApiModelProperty("大厦名称")
    @Column(name = "name", columnDefinition = "varchar(64) comment '大厦名称'")
    private String name;//大厦名称

    @TableField("address")
    @ApiModelProperty("地址")
    @Column(name = "address", columnDefinition = "varchar(64) comment '地址'")
    private String address;//地址


    /// S10 开始，删除了 globalSettingBean，将成员变量合并到edifice里
    @TableField("host")
    // 格式为  IP:port   例如  www.gosnincloud.com:80   或  www.gonsincloud.com
    @ApiModelProperty("主机地址")
    @Column(name = "host", columnDefinition = "varchar(255) comment '主机地址'")
    private String host;

    @ApiModelProperty("系统名字")
    @TableField("title")
    @Column(name = "title", columnDefinition = "varchar(255) comment '系统名字'")
    private String title;

    @ApiModelProperty("系统名字（英文）")
    @TableField("title_en")
    @Column(name = "title_en", columnDefinition = "varchar(255) comment '系统名字（英文）'")
    private String titleEn;

    @ApiModelProperty("登录页背景图")
    @TableField("login_background")
    @Column(name = "login_background", columnDefinition = "varchar(255) comment '登录页背景图'")
    private String loginBackground;

    @ApiModelProperty("后勤人员名字")
    @TableField("service_name")
    @Column(name = "service_name", columnDefinition = "varchar(64) comment '后勤人员名字'")
    private String serviceName;

    @ApiModelProperty("后勤人员电话号码")
    @TableField("service_phone")
    @Column(name = "service_phone", columnDefinition = "varchar(64) comment '后勤人员电话号码'")
    private String servicePhone;

    @ApiModelProperty("管理员的名字")
    @TableField("admin_name")
    @Column(name = "admin_name", columnDefinition = "varchar(64) comment '管理员的名字'")
    private String adminName;

    @ApiModelProperty("管理员的电话号码")
    @TableField("admin_phone")
    @Column(name = "admin_phone", columnDefinition = "varchar(64) comment '管理员的电话号码'")
    private String adminPhone;

    @ApiModelProperty("是否发送警告通知")
    @TableField("send_warning")
    @Column(name = "send_warning", columnDefinition = "tinyint(1) comment '是否发送警告通知'")
    private Boolean sendWarning;

    @ApiModelProperty("可服务的内容，多个用逗号隔开")
    @Convert(converter = StringListConverter.class)
    @TableField(value = "waiter_item", typeHandler = ArrayTypeHandler.class)
    @Column(name = "waiter_item", columnDefinition = "varchar(512) comment '可服务的内容，多个用逗号隔开'")
    private List<String> waiterItem;

    @Deprecated
    @ApiModelProperty("会议类型")
    @TableField(value = "type", exist = false)
    @Transient
    @Column(name = "type", columnDefinition = "text comment '会议类型'")
    private String type;


    @JsonIgnore
    @ApiModelProperty("各个模块自定义服务项")
    @Convert(converter = MapJsonHandler.class)
    @TableField(value = "module_settings", typeHandler = MapJsonHandler.class)
    @Column(name = "module_settings", columnDefinition = "text comment '各个模块自定义服务项'")
    private Map<String, Object> moduleSettings;

    @TableField(value = "type", exist = false)
    @Transient
    @ApiModelProperty("审核方式 枚举AuditWay")
    private Integer auditWay;

    @TableField(value = "type", exist = false)
    @Transient
    @ApiModelProperty("审核时间")
    private Integer auditTime;

    @TableField(value = "type", exist = false)
    @Transient
    @ApiModelProperty("审核时间类型 枚举AuditTimeType")
    private Integer auditTimeType;

    @ApiModelProperty("小程序应用APPID")
    @TableField("mini_appId")
    @Column(name = "mini_appId", columnDefinition = "varchar(64) comment '小程序应用APPID'")
    private String miniAppId;
}
